package net.towee.client.event.core;

import net.towee.model.discussion.Message;

import com.google.gwt.event.shared.GwtEvent;

public class DiscussionMessageReceivedEvent extends GwtEvent<DiscussionMessageReceivedHandler> {
	public static Type<DiscussionMessageReceivedHandler> TYPE = new Type<DiscussionMessageReceivedHandler>();
	private final Message mess;
	private final String discId;
	private final boolean local;

	public DiscussionMessageReceivedEvent(Message second, String first, boolean b) {
		this.mess = second;
		this.discId = first;
		this.local = b;
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<DiscussionMessageReceivedHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(DiscussionMessageReceivedHandler handler) {
		handler.onDiscussionMessageReceived(mess, discId, local);
	}

}
